#ifndef __M_MSG_H__
#define __M_MSG_H__

#include <time.h>
#include <string>
#include <thread>
#include "util.hpp"
#include "level.hpp"

namespace MyLog
{
    struct LogMsg
    {
        LogMsg(LogLevel::Level level, std::string fileName, \
            size_t fileLine, std::string logger, std::string payload)
            :_time(Time::GetTimeStamp())
            ,_level(level)
            ,_fileName(fileName)
            ,_fileLine(fileLine)
            ,_tid(std::this_thread::get_id())
            ,_logger(logger)
            ,_payload(payload)
        {}

        time_t _time;           //日志时间
        LogLevel::Level _level; //日志等级
        std::string _fileName;  //文件名
        size_t _fileLine;       //行号
        std::thread::id _tid;   //线程id
        std::string _logger;    //日志器名称
        std::string _payload;   //日志主体消息
    };
}


#endif